package com.github.butid.data.base;

import com.github.butid.data.codec.RequestBody;
import com.github.butid.data.codec.ResultBody;
import com.github.butid.data.netty.core.Command;

/**
 * @author wangjing.dc@qq.com
 * @since 2020/8/10
 */
public abstract class BaseCommand implements Command<RequestBody> {

    /**
     * 成功返回
     * @param msg
     * @return
     */
    protected ResultBody success(Object msg) {
        return new ResultBody().setCode("00").setMsg(msg);
    }

    protected ResultBody error(Object msg){
        return new ResultBody().setCode("99").setMsg(msg);
    }

    @Override
    public ResultBody exec(RequestBody requestBody) {
        return null;
    }
}
